import React, { memo } from 'react';
import { Select } from 'antd';

const { Option } = Select;
const CustomerSelect = ({ dataList = [], value = '', onChange, styles = {}, disabled }) => <Select
    value={value || undefined}
    size="small"
    style={{ width: 120, marginRight: '8px', ...styles }}
    onSelect={key => {
        if (key !== value) {
            onChange(key);
        }
    }}
    placeholder="请选择"
    disabled={disabled}
>
    {
        dataList.map(item =>
            <Option value={item.key} key={item.label}>{item.label}</Option>
        )
    }
</Select>;
export default memo(CustomerSelect)
